home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMICUS01.ADF
/
ABasicStuff
/
Tools
/
KeyCodes.bas
< prev
next >
Wrap
BASIC Source File
|
1985-12-04
|
1KB
|
29 lines
10 SCNCLR
15 PRINT STRING$(13,"*");" KEYCODES ";STRING$(14,"*")
20 PRINT"* Press any combination of CTRL, *"
25 PRINT"* SHIFT, and ALT, then press any *"
30 PRINT"* key to see the keycodes returned *"
35 PRINT"* for that combination. *"
40 PRINT"* PRESS RETURN OR ENTER TO EXIT. *"
45 PRINT STRING$(37,"*")
55 WHILE CHR%<>13
60 GET CH$
65 IF LEN(CH$)=0 AND CHR%<>-2 THEN PRINT ""
70 IF LEN(CH$)=0 THEN CHR%=-2 ELSE GOSUB 100
75 IF LEN(CH$)<>0 THEN PRINT TAB(TB%); CHR%;CHR$(8);"{DECIMAL",H$;TAB(25);O$;TAB(37);CH$
80 WEND
85 END
100 REM SUBROUTINE THAT CONVERTS INPUT CHARACTERS TO PROPER FORMATS
110 CHR%=ASC(CH$)
111 IF CHR%<10 THEN TB%=3 ELSE IF CHR%<100 THEN TB%=2 ELSE TB%=1
120 H$=HEX$(CHR%)
130 IF LEN(H$)<2 THEN H$="0"+H$
140 IF LEN(H$)<2 THEN H$="0"+H$
145 H$=H$+"{HEX"
150 O$=OCT$(CHR%)
160 IF LEN(O$)<3 THEN O$="0"+O$
170 IF LEN(O$)<3 THEN O$="0"+O$
180 IF LEN(O$)<3 THEN O$="0"+O$
190 O$=O$+"{OCTAL"
250 RETURN